import java.util.Scanner;

public class Test6 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.nextLine();
        String t = sc.nextLine();
        System.out.println(isAnagram(s, t));
    }

    /**
     * 判断t是否是s的子串
     *
     * @param s
     * @param t
     * @return
     */
    public static boolean isAnagram(String s, String t) {
        int slen = s.length();
        int tlen = t.length();
        for (int i = 0; i < slen; i++) {
            int flag = 0;
            for (int j = 0, k = i; j < tlen && k < slen; j++, k++) {
                if (s.charAt(k) == t.charAt(j)) {
                    flag++;
                }
            }
            if (flag == tlen) {
                return true;
            }
        }
        return false;
    }
}
